//
//  DYJDataBaseTool.h
//  FunWay
//
//  Created by dllo on 16/5/26.
//  Copyright © 2016年 dyj. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>

#import <sqlite3.h>
#import "XZHHomeModel.h"
#import "XZHMovieDetailModel.h"


typedef NS_ENUM(NSUInteger, DYJIsSaveDataInTable) {
    DYJInTabel,
    DYJNotInTable,
    DYJSelectError,
};


typedef NS_ENUM(NSUInteger, DYJDataType) {
    DYJCollect,
    DYJLaud,
};


@interface DYJDataBaseTool : NSObject
{
    //  指针
    sqlite3 *dbPoint;
}
/**
 *  创建一个单例工具来判断是否保存
 *
 *  @return 单例
 */
+ (DYJDataBaseTool *)shareDYJDataBaseTool;

/**
 *  添加收藏
 *
 *  @param model   添加的Model(没有把所有的属性都添加)
 */
- (void)insertDataWithReadTitle:(NSString *)title
                           Type:(NSString *)type
                            Url:(NSString *)url;

- (void)insertDataWithHomeModel:(XZHHomeModel *)model;

- (void)insertDataWithMovieModel:(XZHMovieDetailModel *)model;

- (void)insertDataWithNoteContent:(NSString *)content
                            Image:(NSString *)image
                             Data:(NSString *)date
                 PlaceholderImage:(NSString *)placeholderImage;

/**
 *  取消收藏
 *
 *  @param title 通过title
 */
- (void)delegateDataWithTitle:(NSString *)title;
- (void)delegateDataHomeId:(NSString *)hpcontent_id;
- (void)delegateDataMovieId:(NSString *)movie_id;

/**
 *
 *  查询所有数据
 *
 */
- (NSMutableArray *)selectAll;
- (NSMutableArray *)selectAllHp;
- (NSMutableArray *)selectAllMovie;
- (NSMutableArray *)selectAllNote;

// 删除所有数据
- (void)deleteAllCourse;
//是否已存在
- (DYJIsSaveDataInTable)isSaveDataInTableWithTitle:(NSString *)title;
@end
